﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for QuestionDL
/// </summary>
internal class QuestionDL
{
    internal static bool Insert(QuestionBL questionBL)
    {
        return OnlineTestHelper.Context.SP_INSERT_QUESTION(questionBL.QuestionText, questionBL.ImagePath, questionBL.CategoryId, questionBL.UserId) == 0 ? true : false;
    }

    internal static object GetQuestions(string categoryId)
    {
        return OnlineTestHelper.Context.SP_GET_ALL_QUESTIONS(categoryId);
    }

    internal static object GetAnswer(long questionId)
    {
        return OnlineTestHelper.Context.SP_GET_ANSWER(questionId);
    }

    internal static bool Update(QuestionBL questionBL)
    {
        return OnlineTestHelper.Context.SP_UPDATE_QUESTION(questionBL.QuestionId, questionBL.QuestionText, questionBL.CategoryId, questionBL.UserId) == 0 ? true : false;
    }

    internal static bool Delete(QuestionBL questionBL)
    {
        return OnlineTestHelper.Context.SP_DELETE_QUESTION(questionBL.QuestionId) == 0 ? true : false;
    }
}